/**
  ******************************************************************************
  * @file    bsp_key.h
  * @author  
  * @version V1.0
  * @date    2017-xx-xx
  * @brief   
  ******************************************************************************
  * @attention
  *
  *
  ******************************************************************************
  */
	
#ifndef	__BSP_KEY_H
#define	__BSP_KEY_H

#ifdef	__cplusplus
extern	"C"	{
#endif

#include	"stm32f4xx.h"
#include	"bsp_gpio.h"

#define KEY_ON	1
#define KEY_OFF	0
	
#define KEY1_PIN                  GPIO_Pin_0                 
#define KEY1_GPIO_PORT            GPIOA                      
#define KEY1_GPIO_CLK             RCC_AHB1Periph_GPIOA

#define KEY2_PIN                  GPIO_Pin_13                 
#define KEY2_GPIO_PORT            GPIOC                      
#define KEY2_GPIO_CLK             RCC_AHB1Periph_GPIOC
	
void 		Key_GPIO_Config(void);
	
#ifdef	__cplusplus
						}
#endif	

class	cKEY: public cGPIO
{
	public:
		cKEY(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin):cGPIO(GPIOx, GPIO_Pin)
		{
			status_old = KEY_OFF;
		}
		uint8_t	CheckStatus(void);
		uint8_t	GetPreStatus(void);
		void	StoreStatus(uint8_t status);
	private:
		uint8_t	status_old;		
};
						

#endif
